<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@include file="/WEB-INF/templates/common/taglib.jsp"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> 
<html>
<head>
<meta>
<title>解放军第三0五医院</title>
<link rel="stylesheet" href="${basePath}/static/css/print/print.css"/>

<script type="text/javascript" src="${basePath}/static/publics/assets/jquery/jquery.min.js"></script>

 <script src="${basePath}/static/publics/assets/jqprint/jquery-migrate-1.2.1.min.js"></script> 
<script src="${basePath}/static/publics/assets/jqprint/jquery.jqprint-0.3.js"></script>

</head>
<body>
   <div style="width:794px;margin: 0px auto;" id="homePage">
   		<div class="divTitle">中国人民解放军空军航空医学研究所附属医院</div>
   		<div style="letter-spacing:5px;text-align: center;margin-top: 0;font-size: 24px;">住院病案首页</div>
   			<table style="width:100%;font-size: 16px;">
   			<tr><td>医疗保险账户（手册/卡）号：${noteBasic.healthCards}</td>
   			<td>第 ${noteBasic.inHospitalNumber}次住院</td>
   			<td colspan="2">识别码： <c:choose>
						<c:when test="${noteBasic==null}">
						${hospitalizationNote.mr_id}
						</c:when>
						<c:otherwise>
						   ${noteBasic.mrId}
						</c:otherwise>
					</c:choose>
				</td>
   			</tr>
   			<tr>
   			<td colspan="3">医疗付款方式：${noteBasic.payTypeName}</td>
   			<td colspan="2">ID号（ID）：
   				<c:choose>
						<c:when test="${noteBasic==null}">
							${hospitalizationNote.only_id }
						</c:when>
						<c:otherwise>
							${noteBasic.onlyId }
						</c:otherwise>
					</c:choose>
				</td>
   			</tr>
   		</table>
   		<table class="tableContent" style="width:100%;font-size: 16px;">

   			<tbody>
   			<tr>
   			 	<td colspan="2">姓名&nbsp;<c:choose>
							<c:when test="${noteBasic==null}">
								${hospitalizationNote.name }
							</c:when>
							<c:otherwise>
								${noteBasic.name }
							</c:otherwise>
						</c:choose></td>
   			 	<td colspan="2">性别&nbsp;<c:choose>
							<c:when test="${noteBasic==null}">
								${hospitalizationNote.sexName}
							</c:when>
							<c:otherwise>
								${noteBasic.sexName}
							</c:otherwise>
						</c:choose></td>
   			 	<td colspan="3" style="width:190px;">出生&nbsp;<c:choose>
							<c:when test="${noteBasic==null}">
								<fmt:formatDate value="${hospitalizationNote.birthday}" pattern="yyyy-MM-dd" />
							</c:when>
							<c:otherwise>
								<fmt:formatDate value="${noteBasic.birthday}" pattern="yyyy-MM-dd" />
							</c:otherwise>
						</c:choose></td>
   			 	<td>年龄&nbsp;${noteBasic.age}</td>
   			 	<td rowspan="11" colspan="4">
   			 		人员类别：地方<br><br>
   			 		隶属大单位：<br><br>
   			 		勤务：<br><br>
   			 		医疗体系：<br><br><br>
   			 		身份：<br><br>
   			 		费别：${noteBasic.payTypeName}<br><br>
   			 		在职状况：<br><br>
   			 		军事训练伤：
   			 	</td>
   			</tr>
   			<tr>
   			 	<td colspan="2">婚姻&nbsp;${noteBasic.marriageName}</td>
   			 	<td colspan="3">职业&nbsp;${noteBasic.professionName}</td>
   			 	<td colspan="3">出生地&nbsp;${noteBasic.birthAddress}</td>
   			</tr>
   				<tr>
   			 	<td colspan="2">民族&nbsp;${noteBasic.nationName}</td>
   			 	<td colspan="3">国籍&nbsp;${noteBasic.nationalityName}</td>
   			 	<td colspan="3">身份证号<c:choose>
							<c:when test="${noteBasic==null}">
								${hospitalizationNote.id_number }
							</c:when>
							<c:otherwise>
								${noteBasic.idNumber }
							</c:otherwise>
						</c:choose></td>
   			</tr>
   			<tr>
   			 	<td colspan="8">工作单位及地址&nbsp;${noteBasic.workPlace}${noteBasic.workUnit}</td>
   			</tr>
   			<tr>
   			 	<td colspan="5">电话&nbsp;${noteBasic.workUnitPhone}</td>
   			 	<td colspan="3">邮编&nbsp;${noteBasic.workPostCode}</td>
   			</tr>
   			<tr>
   			 	<td colspan="5">户口/常住地址&nbsp;
   			 		<c:choose>
							<c:when test="${noteBasic==null}">
								${hospitalizationNote.address_no}
							</c:when>
							<c:otherwise>
								${noteBasic.familyAddress}
							</c:otherwise>
						</c:choose>
					</td>
   			 	<td colspan="3">邮编&nbsp;${noteBasic.familyPostCode}</td>
   			</tr>
   			<tr>
   			 	<td colspan="3">联系人姓名&nbsp;${noteBasic.linkManName}</td>
   			 	<td colspan="2">关系&nbsp;${noteBasic.relativeRelationName}</td>
   			 	<td colspan="3">电话&nbsp;${noteBasic.linkManPhone}</td>
   			</tr>
   			<tr>
   			 	<td colspan="8">联系人地址&nbsp;${noteBasic.linkManAddress}</td>
   			</tr>
   			<tr>
   			 	<td colspan="4">入院方式&nbsp;
   			 		<c:choose>
							<c:when test="${noteBasic==null}">
							${hospitalizationNote.inHospitalTypeName}
							</c:when>
							<c:otherwise>
							${noteBasic.inHospitalTypeName}
							</c:otherwise>
						</c:choose>
					</td>
   			 	<td colspan="4">入院时情况&nbsp;${noteBasic.inHospitalStateName}</td>
   			</tr>
   			<tr>
   			 	<td colspan="5">门（急）诊诊断&nbsp;
   			 		<c:choose>
   			 			<c:when test="${hospitalizationDiagnosisInfo.hospitalizationDiagnosis!=null}">
   			 				<c:forEach var="diagnosis" items="${hospitalizationDiagnosisInfo.hospitalizationDiagnosis }">
									<c:if test="${diagnosis.diagnoseTypeId==1 }">
										${diagnosis.diseaseName}
										<input style="display: none" id="diseaseCode" type="text" value="${diagnosis.diseaseCode}">
									</c:if>
   			 				</c:forEach>
   			 			</c:when>
   			 		</c:choose>
   			 	</td>
   			 	<td colspan="3">ICD&nbsp;<span id="outpatient"></span></td>
   			</tr>
   			<tr>
   			 	<td colspan="3">接诊日期&nbsp;</td>
   			 	<td colspan="3">门诊医生&nbsp;</td>
   			 	<td colspan="2">经办人&nbsp;</td>
   			</tr>
   			<tr>
   			 	<td colspan="8">
   			 		<c:choose>
							<c:when test="${noteBasic==null}">
								<fmt:formatDate var="in_hospital_date"
									value="${hospitalizationNote.in_hospital_date}"
									pattern="yyyy-MM-dd HH:mm:ss" />
							</c:when>
							<c:otherwise>
								<fmt:formatDate var="in_hospital_date"
									value="${noteBasic.inHospitalDate}"
									pattern="yyyy-MM-dd HH:mm:ss" />
							</c:otherwise>
						</c:choose>
						${in_hospital_date }入
						 <c:choose>
							<c:when test="${noteBasic==null}">
								${hospitalizationNote.inDeptName}
							</c:when>
							<c:otherwise>
								${noteBasic.inDeptName}
							</c:otherwise>
						</c:choose> 	<br>
					<c:forEach var="changeOffice" items="${hospitalChangeOfficeInfo.hospitalizationChangeOffices }">
						<c:if test="${changeOffice.inOfficeName !=''}">
							<fmt:formatDate value="${changeOffice.changeOfficeDate}" pattern="yyyy-MM-dd" /> 入 ${changeOffice.inOfficeName }<br>
						</c:if>
					</c:forEach>
					 <c:choose>
                                   <c:when test="${noteBasic==null}">
                                    	<fmt:formatDate var="out_hospital_date" value="${hospitalizationNote.out_hospital_date}" pattern="yyyy-MM-dd HH:mm:ss"/>
                                   </c:when>
                                   <c:otherwise>
                            			<fmt:formatDate var="out_hospital_date" value="${noteBasic.outHospitalDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
                                   </c:otherwise>
                                </c:choose>	
						
							${out_hospital_date }从
						 <c:choose>
							<c:when test="${noteBasic==null}">
								${hospitalizationNote.outDeptName}
								
							</c:when>
							<c:otherwise>
								${noteBasic.outDeptName}
							</c:otherwise>
						</c:choose> 出院
   			 	</td>
   			 	<td rowspan="2" colspan="4">
   			 		确诊日期：<fmt:formatDate var="diagnosisConfirmedDate" value="${noteBasic.diagnosisConfirmedDate}" pattern="yyyy-MM-dd"/><br><br>
   			 		确诊天数：<br><br>
   			 		住院天数：
   			 	</td>
   			</tr>
   			<tr>
   			 	<td colspan="6">入院初步诊断 &nbsp;
   			 		<c:choose>
   			 			<c:when test="${hospitalizationDiagnosisInfo.hospitalizationDiagnosis!=null}">
   			 				<c:forEach var="diagnosis" items="${hospitalizationDiagnosisInfo.hospitalizationDiagnosis }">
									<c:if test="${diagnosis.diagnoseTypeId==5 }">
										${diagnosis.diseaseName}
										<input style="display: none" id="inHosDiagnosis" type="text" value="${diagnosis.diseaseCode}">
									</c:if>
   			 				</c:forEach>
   			 			</c:when>
   			 		</c:choose>
   			 	</td>
   			 	<td colspan="2">ICD &nbsp;<span id="inHosDiseaseCode"></span></td>
   			</tr>
				<tr>
					<td colspan="8" align="center">出院诊断</td>
					<td>确诊日期</td>
					<td>出院情况</td>
					<td>治疗天数</td>
					<td>ICD</td>
				</tr>
			 <c:forEach var="diagnosis" items="${hospitalizationDiagnosisInfo.hospitalizationDiagnosis }">
				
				<c:if test="${diagnosis.diagnoseTypeId==22 }">
					<input style="display: none" type="text" value="${diagnosis.diseaseName }" id="harmDiagnosisName">
					<input style="display: none" type="text" value="${diagnosis.diseaseCode }" id="harmDiagnosisCode">
				</c:if>
				<c:if test="${diagnosis.diagnoseTypeId==24 }">
					<input style="display: none" type="text" value="${diagnosis.diseaseName }" id="deathDiagnosisName">
					<input style="display: none" type="text" value="${diagnosis.diseaseCode }" id="deathDiagnosisCode">
				</c:if>
				<c:if test="${diagnosis.diagnoseTypeId!=22 and diagnosis.diagnoseTypeId!=24}">
					<tr>
						<td colspan="8">${diagnosis.diagnoseTypeName }&nbsp;${diagnosis.diseaseName }</td>
						<td style="width:85px;"><fmt:formatDate value="${diagnosis.confirmedDate}" pattern="yyyy-MM-dd"/></td>
						<td>${diagnosis.treatmentResultName}</td>
						<td></td>
						<td>${diagnosis.diseaseCode }</td>
					</tr>
				</c:if>
   			 </c:forEach>
				<tr>
   				<td colspan="9">病理诊断 &nbsp;</td>
   				<td colspan="3">ICD &nbsp;</td>
   			</tr>
   			<tr>
   				<td colspan="9">损伤、中毒的外部原因 &nbsp;<span id="harmDiseaseName"></span></td>
   				<td colspan="3">ICD &nbsp;<span id="harmDiseaseCode"></span></td>
   			</tr>
   			<tr>
   				<td colspan="8">根本死亡原因 &nbsp;<span id="deathDiseaseName"></span></td>
   				<td colspan="2">ICD &nbsp;<span id="deathDiseaseCode"></span></td>
   				<td colspan="2">尸检 
   					<c:choose>
                            		<c:when test="${noteBasic.autopsy == true}">
                            			是
                            		</c:when>
                            		<c:otherwise>
                            			否
                            		</c:otherwise>
                            	</c:choose>
   				</td>
   			</tr>
   			<tr>
   				<td colspan="2" rowspan="2">手术操作日期</td>
   				<td colspan="3" rowspan="2">手术操作名称</td>
   				<td colspan="3" align="center">手术、操作医师</td>
   				<td rowspan="2">麻醉方式</td>
   				<td rowspan="2">切口愈合等级</td>
   				<td rowspan="2">麻醉医师</td>
   				<td rowspan="2">手术、操作编码</td>
   			</tr>
				<tr>
   				<td>术者</td>
   				<td>I助</td>
   				<td>II助</td>
   			</tr>
   				<c:forEach var="operation" items="${operationInfo.operations}" varStatus="s">
					<tr>
						<td colspan="2">
						<div style="width:155px;">
								<fmt:formatDate value="${ operation.operationStartDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
						<fmt:formatDate value="${operation.operationEndDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
						</div>
					</td>
						<td colspan="3">${operation.operationName}</td>
						<td></td>
   						<td></td>
   						<td></td>
						<td>${operation.anaesthesiaTypeName}</td>
						<td>${operation.incisionLevelName}${operation.cicatrizationTypeName}</td>
						<td></td>
						<td>${operation.operationCode}</td>
					</tr>

				</c:forEach>
   			<tr>
   				<td colspan="12">
   					<div style="width:120px;float: left">诊断符合情况 </div>
   				</td>
   			</tr>
   			<tr>
   			 	<td colspan="12">
   			 		<div class="tdDiv1">住院期间 </div>
   					<div class="tdDiv1">病危&nbsp;&nbsp;天</div>
   					<div class="tdDiv1">病重&nbsp;&nbsp;天</div>
   					<div class="tdDiv2">抢救 &nbsp;${hospitalizationCureInfo.rescueNumber }&nbsp;次</div>
   					<div class="tdDiv2">抢救成功&nbsp;${hospitalizationCureInfo.rescueSucceedNumber }&nbsp;次</div>
   					<div class="tdDiv1">ICU&nbsp;&nbsp;天</div><br>
   					<div style="width:110px;float: left;margin-left: 110px;">CCU&nbsp;&nbsp;天</div>
   					<div class="tdDiv1">特护&nbsp;&nbsp;天</div>
   					<div class="tdDiv2">一级护理&nbsp;&nbsp;天</div>
   					<div class="tdDiv2">二级护理&nbsp;&nbsp;天</div>
   					<div class="tdDiv2">发生褥疮&nbsp;&nbsp;天</div>
   				</td>
   			</tr>
   			<tr>
   			 	<td colspan="12">
   			 		药物过敏
   				</td>
   			</tr>
   			<tr>
   			 	<td colspan="12">
   			 		${hospitalizationCureInfo.rhBloodTypeName}
   				</td>
   			</tr>
   			<tr>
   			 	<td colspan="12">
   			 		手术、治疗、检查、诊断为本院第一例：
   				</td>
   			</tr>
   			<tr>
   			 	<td colspan="12">
   			 		随诊：
   			 		<c:choose>
							<c:when test="${true == hospitalizationCureInfo.followUpClinicLimit}">
                            			是
                            		</c:when>
							<c:otherwise>
                            			否
                            		</c:otherwise>
						</c:choose> 
   			 		
   			 		随诊期限：&nbsp;&nbsp;${hospitalizationCureInfo.followUpClinicNumberOfDays}天&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;示教病例：
   				</td>
   			</tr>
   			<tr>
   			 	<td colspan="12">
   			 		<div class="tdDiv2">血型&nbsp;${hospitalizationCureInfo.bloodTypeName } </div>
   					<div class="tdDiv2">RH&nbsp;${hospitalizationCureInfo.rhBloodTypeName } </div>
   					<div class="tdDiv2">输血&nbsp;${count}&nbsp;次</div>
   					<div class="tdDiv2">输血反应&nbsp;${transfusionReactionCount}&nbsp;次</div><br>
   					<div style="width:80px;float: left">输血品种：</div>
   					<div class="tdDiv4">1.红细胞：${redBloodCellVolumeCount }单位</div>
   					<div class="tdDiv4">2.血浆：${plasmaVolumeCount}单位</div>
   					<div class="tdDiv4">3.血小板：${thrombocyteVolumeCount }单位</div><br>
   					<div style="width:180px;float: left;margin-left: 80px;">4.全血：${wholeBloodVolumeCount }单位</div>
   					<div class="tdDiv4">5.其他： ${otherInfo }</div>
   					<div style="width:210px;float: left">自身输血：共&nbsp;${autoBloodVolumeCount }&nbsp;ml</div>
   				</td>
   			</tr>
   			<tr>
   			 	<td colspan="12">
   			 		<div style="float: left">住院费用总计（元）： </div><br>
   					<div class="tdDiv4">床位</div>
   					<div class="tdDiv4">西药</div>
   					<div class="tdDiv4">中药</div><br>
   					<div class="tdDiv4">检验</div>
   					<div class="tdDiv4">放射</div>
   					<div class="tdDiv4">特检</div>
   					<div class="tdDiv4">治疗</div><br>
   					<div class="tdDiv4">输血</div>
   					<div class="tdDiv4">手术  </div>
   					<div class="tdDiv4">护理</div>
   					<div class="tdDiv4">其他</div>
   				</td>
   			</tr>
   			<tr>
   			 	<td colspan="12">
   			 		<div class="tdDiv3">科主任</div>
   					<div class="tdDiv3">主任医师</div>
   					<div class="tdDiv3">主治医师</div>
   					<div class="tdDiv3">住院医师</div>
   				</td>
   			</tr>
   			<tr>
   			 	<td colspan="12">
   			 		<div class="tdDiv3">进修医师</div>
   					<div style="width:230px;float: left">研究生实习医师</div>
   					<div class="tdDiv4">实习医师</div>
   					<div class="tdDiv4">编码员</div>
   				</td>
   			</tr>
   			<tr>
   			 	<td colspan="12">
   			 		<div class="tdDiv3">病案质量</div>
   					<div class="tdDiv3">质控医师</div>
   					<div class="tdDiv3">质控护士</div>
   					<div class="tdDiv3">日期</div>
   				</td>
   			</tr>
   			<tr>
   			 	<td colspan="12">
   			 		说明：医疗付款方式&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
   			 		<div style="width:200px;float: left">1.社会基本医疗保险</div>
   					<div class="tdDiv1">2.公费医疗</div>
   					<div class="tdDiv1">3.大病统筹</div>
   					<div class="tdDiv1">4.商业保险</div><br>
   					<div class="tdDiv1">5.自费医疗</div>
   					<div class="tdDiv1">6.军队医疗</div>
   					<div class="tdDiv1">7.其他</div>
   					住院费用总计凡可由计算机提供住院费用清单的，住院首页中可不填
   				</td>
   			</tr>
   			</tbody>
   			
   		</table>
   		</div>
   	<input type="button" onclick="print()" value="打印" class="printButton"/>
</body>
<script type="text/javascript">

$(function(){
	$("#outpatient").text($("#diseaseCode").val());
	$("#inHosDiseaseCode").text($("#inHosDiagnosis").val());
	
	$("#harmDiseaseName").text($("#harmDiagnosisName").val());
	$("#harmDiseaseCode").text($("#harmDiagnosisCode").val());
	$("#deathDiseaseName").text($("#deathDiagnosisName").val());
	$("#deathDiseaseCode").text($("#deathDiagnosisCode").val());
	
});

function print(){
	$("#homePage").jqprint();
}
</script>
</html>